package com.medusa.aps.business.modules.security.mp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.medusa.aps.business.model.pagination.Page;
import com.medusa.aps.business.modules.security.model.input.RoleQueryPara;
import com.medusa.aps.business.modules.security.mp.entity.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @author: xianhui.yu
 **/
public interface RoleMapper extends BaseMapper<Role> {

    /**
     * 列表分页
     *
     * @param roleQueryPara 查询参数
     * @return Page<Role> 分页数据
     */
    Page<Role> listPage(@Param("roleQueryPara") RoleQueryPara roleQueryPara);


    /**
     * 通过用户ID查询角色集合
     *
     * @param userId:
     * @return: java.util.List<Role>
     */
    List<Role> selectRoleByUserId(@Param("userId") Integer userId);

    /**
     * 通过菜单ID查询角色集合
     *
     * @param menuId:
     * @return: java.util.List<Role>
     */
    List<Role> selectRoleByMenuId(@Param("menuId") Integer menuId);

}
